package com.xiaotu.es.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author zhangxiao
 * @create 2022-04-11 15:40
 */
@Data
@Document(indexName = "user", shards = 3, replicas = 2)
public class User {

    @Id
    @Field(type = FieldType.Integer)
    private Integer userId;

    /**
     * FieldType.Keyword 关键字  不分词
     */
    @Field(type = FieldType.Keyword)
    private String name;

    @Field(type = FieldType.Integer)
    private Integer sex;


    //@Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    @Field(type = FieldType.Text, analyzer = "standard", searchAnalyzer = "ik_smart")
    private String school;
}
